home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI682.ASC
< prev
next >
Wrap
Text File
|
1993-05-07
|
3KB
|
133 lines
PRODUCT : Paradox NUMBER : 682
VERSION : All
OS : DOS
DATE : May 7, 1993 PAGE : 1/2
TITLE : Converting Text Fields to Initial Caps
It is sometimes desirable to format all of the words in an
Alphanumeric field to initial capitals. For example, if the data
in a Name fields reads "ED SMITH", you may want it to read "Ed
Smith". This can be accomplished by using a PAL script.
The example shown below illustrates how you can use the PAL SCAN
command, FORMAT function and LOWER function to convert the data
in an Alphanumeric field to initial capitals. In your script,
you will need to substitute your table name for TBLNAME, and you
will need to substitute the field name that you wish to change
for FLDNAME.
Before making global changes to your table, it is a good idea to
first make a backup copy.
Creating the script
1. From the Paradox Main menu, choose Scripts | Editor | New
(for version 3.5 and earlier, choose Scripts | Editor |
Write).
2. When prompted, type in a name for the script (for example,
CAPS), then press [Enter].
3. Type in the following PAL code:
Coedit "TBLNAME" ; Substitute your table
; name for TBLNAME
Moveto [FLDNAME] ; Substitute your field
; name for FLDNAME
Scan ; Scans every record
[]=Format("CC", Lower([])) ; Converts field to
; initial caps.
Endscan
4. When you are finished typing the PAL code, press [F2] to
save your script.
PRODUCT : Paradox NUMBER : 682
VERSION : All
OS : DOS
DATE : May 7, 1993 PAGE : 2/2
TITLE : Converting Text Fields to Initial Caps
To play the script
1. From the Main menu, choose Scripts | Play.
2. When prompted, type in the name of your script, then press
[Enter].
For information on the SCAN command, FORMAT function and LOWER
function, refer to the PAL Reference manual (for version 3.5 and
earlier, refer to the PAL User's Guide).
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.